#ifndef __DL_KIT__
#define __DL_KIT__
#include "opencv.hpp"

#ifdef VINORT_EXPORT
#define VINORT_API  __declspec(dllexport)
#else
#define VINORT_API __declspec(dllimport)
#endif

//the index of value 
//for example
/*
Detection det;
det.value[IDX_OF_CCT]
*/
#define IDX_OF_CCT 3
#define IDX_OF_V 2



class VINORT_API DLKit
{
public:
	static double RGBToCCT(int R = 255, int G = 255, int B = 255);
	static void CCTToRGB(int kelvin, int* r, int* g, int* b);
	static float OverlapArea(cv::Rect2f A, cv::Rect2f B);
	static int OverlapArea(cv::Rect A, cv::Rect B);
	static float OverlapAreaRatio(cv::Rect A, cv::Rect B);

	//no use for user
	static cv::Mat formatToSquare(const cv::Mat& img, std::vector<double>& paddings, std::vector<int> new_shape = { 640,640 });
	static void crop_image(cv::Mat& InputArray, cv::Mat* OutPutArray, float Row1, float Col1, float Row2, float Col2);

	struct xydata {
		float x = 0.0;
		float y = 0.0;
		float w = 0.0;
		float h = 0.0;
	};
	static void xywh2cxywh(const xydata xywh, xydata& cxywh, int imageWidth, int imageHeight);
};
#endif

